<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <button>方法监听事件</button>
    <script>
        function fun() {
            alert(22);
            alert(11);
        }
        let bth = document.querySelector('button');
        bth.addEventListener('click',fun)
    </script>
</body>
</html>